
<template>
  <div>
    <h1>我是child组件</h1>
  <p>姓名：{{ name }}</p>
  <p>年龄：{{ age }}</p>
  <p>性别：{{ sex }}</p>
  <button @click="changeName">更改姓名</button>
  </div>
</template>

<script setup>
import { useUsersStore } from '../src/store/user'
import { storeToRefs } from 'pinia'
const store = useUsersStore()
const { name, age, sex } = storeToRefs(store)
const changeName = () => {
  store.name = '小猪课堂'
}
</script>

<style lang="scss" scoped>

</style>
